package com.haliyoo.adhs.common;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;

public class ResultData<T> {
	private String code;
	private List<T>  dataList;
	
	public void putData(T data){
		if(dataList == null){
			dataList = new ArrayList<T>();
		}
		dataList.add(data);
	}
	public void setFirstData(T data){
		if(dataList == null){
			dataList = new ArrayList<T>();
			dataList.add(null);
		}
		dataList.set(0, data);
	}
	public T getFirstData(){
		if(dataList != null && dataList.size()>0){
			return dataList.get(0);
		}
		return null;
	}
	
	/* GETTERS & SETTERS */
	
	public List<T> getDataList() {
		return dataList;
	}
	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}

}
